import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import axios from "axios";
import "babel-polyfill";
import Tabel from "vue-table-with-tree-grid";
import './global.css'
import vueQuill from 'vue-quill-editor'
import _ from 'lodash'
import echarts from 'echarts'
Vue.use(vueQuill)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.prototype.$echarts = echarts
Vue.component("tree-table", Tabel);


Vue.filter('dateFormat',(value)=>{
  var date = new Date(value)
  const year = date.getFullYear()
  const month = date.getMonth() +1
  const day = date.getDate()
  return year+'年'+month+'月'+day+'日'
})
Vue.prototype.$http = axios;
axios.defaults.baseURL = "http://127.0.0.1:8888/api/private/v1/";

axios.interceptors.request.use((config) => {
  config.headers.Authorization = window.sessionStorage.getItem("token");
  return config;
});

Vue.config.productionTip = false;

new Vue({
  router,
  render: (h) => h(App),
}).$mount("#app");
